#include<gtest/gtest.h>
#include<iostream>
#include<unordered_map>
#include<string>
std::unordered_map<std::string,std::string> map;
class MyEnvironment:public testing::Environment{
    public:
    virtual void SetUp()override{
        std::cout<<"全局测试套件初始化!"<<std::endl;
    }
    virtual void TearDown()override{
        std::cout<<"全局测试套件的清理!"<<std::endl;
    }
    private:
};

class MapEnvironment:public testing::Environment{
    public:
    virtual void SetUp()override{
        map.insert(std::make_pair("你好","heelo"));
        map.insert(std::make_pair("apple","苹果"));
    }
    virtual void TearDown()override{
        std::cout<<"全局测试套件的清理!"<<std::endl;
    }
};
TEST(MapEnvironment,test1)
{
    ASSERT_EQ(map.size(),2);
    map.erase("apple");
}TEST(MapEnvironment,test2)
{

    //ASSERT_EQ(map.size(),2);
}

TEST(MyEnvironment,test1)
{
    std::cout<<"测试用例1!"<<std::endl;
}
TEST(MyEnvironment,test2)
{
    std::cout<<"测试用例2!"<<std::endl;
}
int main(int argc,char*argv[])
{
    MyEnvironment env1;
    MapEnvironment env2;
    testing::InitGoogleTest(&argc,argv);
    testing::AddGlobalTestEnvironment(&env2);
    testing::AddGlobalTestEnvironment(&env1);
    RUN_ALL_TESTS();
    return 0;
}